package com.baking.util;

/**
 * @Author:wrb
 * @Date :2019/12/31/8:46
 * @Describtion:返回页面封装对象
 **/
public class Msg extends BaseView {
    private Object pageData;
    private String msg;
    private String returnValue="Ok";
    private String errorKey;

    //返回失败
    public void doError(String errorMsg){
        this.setErrorKey(GloabalMsg.RETURN_ERROR);
        this.setMsg(errorMsg);
    }

    //返回成功
    public void deSuccess(Object pageData){
        this.setErrorKey(GloabalMsg.RETURN_OK);
        this.setPageData(pageData);
    }

    public Object getPageData() {
        return pageData;
    }

    public void setPageData(Object pageData) {
        this.pageData = pageData;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getReturnValue() {
        return returnValue;
    }

    public void setReturnValue(String returnValue) {
        this.returnValue = returnValue;
    }

    public String getErrorKey() {
        return errorKey;
    }

    public void setErrorKey(String errorKey) {
        this.errorKey = errorKey;
    }

    @Override
    public String toString() {
        return "Msg{" +
                "pageData=" + pageData +
                ", msg='" + msg + '\'' +
                ", returnValue='" + returnValue + '\'' +
                ", errorKey='" + errorKey + '\'' +
                '}';
    }
}
